const path = require('path');
function resolve(dir) {
  return path.join(__dirname, dir);
}
let host="http://localhost:9527"
module.exports = {
  lintOnSave: false,
  publicPath: './', //设置后打包文件可以在浏览器访问
  productionSourceMap: true,
  // outputDir: path.resolve(__dirname, localBuildEnv ? `./dist_${localBuildEnv}` : './dist'),
  devServer: {
    disableHostCheck: true,
    port: 8080,
    https: false,
    hotOnly: true,
    proxy: {
      '/': {
        target: host,
        secure: false,
        changeOrigin: true
      },
      
    }
  },
  chainWebpack: (config) => {
    // 路径别名
    config.resolve.alias
      // 实施包
      .set('@', resolve('./src'))
      .set('@components', resolve('./src/components'))
      .set('@views', resolve('./src/views'))
    // 输出文件加hash
    config.output.filename('[name].[hash].js').end();
  },
  
};
